import { EntityObjectFactory } from './../entityObjectFactory';
import { Employee } from "./employee";
var EntityObject = EntityObjectFactory.GetEntityObjectType();

/**
 * TableParty 台桌服务记录
 */
export class TableParty extends EntityObject<TableParty>{
    constructor(ctx?) { super(ctx); }
    id: string = null;
    //店铺id
    storeId: string = null;
    //台桌ID
    tableId: string = null;
    tableName: string = null;
    //加入合并台桌id。null表示独立台桌
    tableGroupId: string = null;
    //开台时间
    openedTime: any = null;
    //关台时间
    closedTime: any = null;
    // opening 使用中 closed 台桌已经关闭停止服务  settled: 已经结算状态
    status: string = null;
    //订单号，清台的TP没有订单
    orderId: string = null;
    //是否有效台桌使用。例如未就餐的台桌服务为无效台桌服务。开始默认为 true
    valid: boolean = true;

    extended: TablePartyExtended = null;

    /**
     * 服务员列表
     * {id:员工雇员编号Employee.id,name:员工姓名：Employee.user.name}
     * @type {{ id: string, name: string }[]}
     * @memberof TableParty
     */
    waiter?: { id: string, name: string }[] = null;

    /**
     * 清台员列表
     * {id:员工雇员编号Employee.id,name:员工姓名：Employee.user.name}
     * @type {{ id: string, name: string }[]}
     * @memberof TableParty
     */
    busser?: { id: string, name: string }[] = null;
    //清台完成时间
    cleaningTime?: any = null;

    toString(): string { return "TableParty"; }
}

interface TablePartyExtended {
    headCount: number;
    creator: {
        id: string;
        name: string;
    }
}